package com.cwnu.mapper;

import com.cwnu.entity.Remark;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RemarkMapper {
    @Select("select create_id from article where id = #{articleId}")
    Integer getUserId(Integer articleId);

    @Insert("insert into remark(user_id, article_id, type,content, create_time) values(#{userId}, #{articleId}, #{type}, #{content},#{createTime})")
    int add(Remark remark);

    @Select("select * from remark where user_id = #{userId}")
    List<Remark> getRemarkList(Integer userId);
}
